// 路由自动生成约定配置
const pages = [];
const pageWrapper = import.meta.glob("@/views/**/*_index.vue");
// Object.entries(pageWrapper).forEach(([path, meta]) => {
//   const pathName = path.replace("/src/view/", "").replace(".vue", "");
//   pages.push({
//     path: "/" + pathName,
//     component: pageWrapper[path],
//     name: pathName.split("/")[1].split("_")[0],
//     title: pageWrapper[path].title || path.replace('/index', ''),
//     keyName: path.replace('/index', ''),
//   });
// });
Object.entries(pageWrapper).forEach(([path, meta]) => {
  const pathName = path.replace('/src/view/', '').replace('.vue', '')
  pages.push({
    path:  pathName,
    component: pageWrapper[path],
    name: pathName.replaceAll('/', '-'),
    title: pathName.split("/")[4].split("_")[0],
  })
})

export default pages;
